<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="bootstrap-3.4.1-dist/css/bootstrap.css">
</head>

<body>
    <table class="table table-hover table-responsive">
        <thead>
            <tr>
                <th>序号</th>
                <th>用户名</th>
                <th>账户</th>
                <th>手机号</th>
                <th>密码</th>

            </tr>
        </thead>
        <tbody id="tbCard">

        </tbody>
    </table>
    <script src="./js/jquery-3.6.3.min.js"></script>
    <script src="data/database.js"></script>
    <script src="data/dataManage.js"></script>
    <script src="bootstrap-3.4.1-dist/js/bootstrap.min.js"></script>
    <script>
        //显示数据
        displayData();
        function displayData() {
            // $("#tbCard").empty();
            let data = JSON.parse(localStorage.getItem("userChaxun"));
            console.log(data)
            $("#tbCard").html('');
            let fragment = document.createDocumentFragment();
            for (let i = 0; i < data.length; i++) {
                let tr = document.createElement("tr");
                tr.innerHTML = `
        <td>${data[i].id}</td>
        <td>${data[i].userName}</td>
        <td>${data[i].account}</td>
        <td>${data[i].phoneNumber}</td>
        <td>${data[i].pwd}</td>
       
        `
                fragment.appendChild(tr);

            }
            $("#tbCard").append(fragment);
        }
    </script>
</body>

</html>